﻿@model Jb.Web.ViewModels.LogOnModel

@{  
    //DateTime date = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 17, 30, 00);
    bool _IsEmployer = String.Compare(WebUtil.GetQueryStringValue("type"), "e", true) == 0 ? true : false;
    bool _IsAdmin = String.Compare(WebUtil.GetQueryStringValue("type"), "a", true) == 0 ? true : false;
    String pageTitle = _IsEmployer ? "Login as Employer" : "Login as Job Seeker";
    if(_IsAdmin){
        pageTitle = "Login as Site Administrator";
    }
    ViewBag.Title = Html.GetPageTitle(pageTitle);
}
<div class="jb-page-heading">
    <h1>@pageTitle</h1>
    <div>
        @if(_IsEmployer){
            <text>Please enter your user name and password. 
            @Html.PublicLink("Register", "Company", "Registration") here as a company if you don't have an Employer account.</text>
        }
        else if(_IsAdmin) {
            <text>Please enter your user name and password.</text>
        }
        else{ //Job Seeker
            <text>Please enter your Email Address as user name and password. @Html.PublicLink("Register", "JobSeeker", "Registration") here if you don't have an account.</text>
        }
    </div>
</div>

<div class="jb-page-content">
@using (Html.BeginForm()) {    
    @Html.ValidationMessage(AppConstants.Validation.INVALID_USER)
    <div class="editor-label">
        <label for="UserName">@if (_IsEmployer || _IsAdmin)
                              { <text>User Name</text>}
                              else { <text>Email Address</text> }</label>
        @*@Html.LabelFor(m => m.UserName)*@
    </div>
    <div class="editor-field">
        @*<a href="#" class="btn btn-large btn-danger" data-toggle="popover" title="" data-content="And here's some amazing content. It's very engaging. right?" data-original-title="A Title">Click to toggle popover</a>*@
        @Html.TextBoxFor(m => m.UserName, new { data_toggle="popover", data_content = "If you are a jobseeker, please provide your registered email as username.", data_original_title="Username Info"})
        @Html.ValidationMessageFor(m => m.UserName)
    </div>

    <div class="editor-label">
        @Html.LabelFor(m => m.Password)
    </div>
    <div class="editor-field">
        @Html.PasswordFor(m => m.Password)
        @Html.ValidationMessageFor(m => m.Password)
    </div>

    <div class="editor-label jb-inline-label">
        @Html.CheckBoxFor(m => m.RememberMe)
        @Html.LabelFor(m => m.RememberMe)
    </div>
    <div class="jb-button-container">
        <button class="btn btn-primary" type="submit"><i class="icon-user icon-white"></i> Login</button>
    </div>
}
</div>

@section RightSideBar
{
    <ul class="nav nav-list">
        <li>Advertisement One</li>
        <li>Advertisement Two</li>
        <li>Advertisement Three</li>
        <li>Advertisement Four</li>
    </ul>
}

@section JavaScriptPlaceHolder
{
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}
